package com.hanZhe.shiro;

import java.util.LinkedHashMap;

/**
 * Created by shw on 2018-02-28.
 */
public class filterChainDefinitionMapBuilder {

    public LinkedHashMap<String,String> mapMethod(){
        LinkedHashMap<String,String> map=new LinkedHashMap<>();

//        访问数据表，得到map集合
        map.put("/login.jsp","anon");
        map.put("/shiro/login","anon");
        map.put("/user/getUser","anon");
        map.put("/shiro/logout","logout");
//        认证之后且拥有权限才能访问
        map.put("/user.jsp","authc,roles[user]");
        map.put("/admin.jsp","authc,roles[admin]");
//        通过记住我和认证之后可以访问我（user过滤器）
        map.put("/list.jsp","user");

        map.put("/**","authc");

        return map;
    }
}
